// @ts-ignore
/* eslint-disable */
import request from "@/util/request.ts";

/** 此处后端没有提供注释 POST /post/like/action */
export async function likeAction(
  body: API.AddPostLikeDTO,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>("/post/like/action", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /post/like/my/list */
export async function getUserLikedPosts(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getUserLikedPostsParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageCommunityPostVO>("/post/like/my/list", {
    method: "GET",
    params: {
      // current has a default value: 1
      current: "1",
      // pageSize has a default value: 10
      pageSize: "10",
      ...params,
    },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /post/like/status/${param0} */
export async function getLikeStatus(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getLikeStatusParams,
  options?: { [key: string]: any }
) {
  const { postId: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(`/post/like/status/${param0}`, {
    method: "GET",
    params: { ...queryParams },
    ...(options || {}),
  });
}
